<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery.min.js"></script>
</head>
<body>

<form enctype="multipart/form-data">
    <input type="file" name="img">
    <button class="submit">提交</button>
</form>



<script>
    $('button').on('click', function () {
        $.ajax({
            url: '/upload',
            type: 'post'
        }).done((res) => {
            console.log(res);
        })
    })
</script>
</body>
</html>